{extend name="public/base" /}
{block name="style"}<link href="__LIB__/fileinput/css/fileinput.min.css" rel="stylesheet" /> {/block}
 {block name="body"}
 <div class="content-tabs">
	<ol class="breadcrumb">
		<li>
			<a href="{:url('web/index/index')}"><i class="fa fa-home"></i></a>
		</li>
		<li>
			<a href="{:url('index')}">员工管理</a>
		</li>
		<li><strong>编辑员工</strong></li>
	</ol>
</div>
<div class="ibox float-e-margins">
	<div class="ibox-content">
		<form   id="myForm" class="form-horizontal m-t" method="post" action="{:url('edit')}">
			<input type="hidden" id="id" name="id" value="{$list.id}" />
			<!--基本信息-->
			<div class="panel panel-default">
			<div class="panel-heading"> 基本信息</div>
				<div class="panel-body">
				<div class="form-group">
					<label class="col-sm-3 control-label">工号：</label>
					<div class="input-group col-sm-4">
						<input type="text" id="no" name="no" value="{$list.no}" class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">姓名：</label>
					<div class="input-group col-sm-4">
						<input type="text" id="name" name="name" value="{$list.name}" class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">职位：</label>
                    <div class="input-group col-md-4">
                        <select class="form-control" name="z_id" id="z_id">
							<option value="0">选择职位</option>
							{volist name="zhiwei" id="vo"}
								<option value="{$vo.id}" {if $list.z_id==$vo.id}selected="selected"{/if}>{$vo.name}	
								</option>
							{/volist}		
						</select>
                    </div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">店铺：</label>
					<div class="input-group col-sm-4">
                        <select class="form-control" name="agent_id" id="agent_id">
                        		<option value="{$storeid}">{$storename}</option>
							{volist name="storelist" id="st"}
								<option value="{$st.id}" {if $list.agent_id==$st.id}selected="selected"{/if}>{$st.name}	
								</option>
							{/volist}		
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">手机号：</label>
					<div class="input-group col-sm-4">
						<input type="text" id="mobile" name="mobile"  value="{$list.mobile}" class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">性别：</label>
					<div class="input-group col-sm-3">
					<input type="radio" name="sex" value="男" {if $list.sex=='男'}checked="checked"{/if}/> 男
					&nbsp;
					<input type="radio" name="sex" value="女" {if $list.sex=='女'}checked="checked"{/if}/> 女
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">生日：</label>
					<div class="input-group col-sm-4">
						<input id='birthday' name='birthday' value="{$list.birthday}" onclick="WdatePicker({dateFmt:'MM-dd',readOnly:true})"  type='text' placeholder="" class="form-control layer-date" />
						填写月和日，即可收到生日短信（需要管理员开启短信通知）
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">备注：</label>
					<div class="input-group col-sm-4">
						<textarea style="width: 500px;height: 200px;" id="memo" name="memo">{$list.memo}</textarea>
					</div>
				</div>
			</div>
			<!--自定义属性end-->
			<div class="hr-line-dashed"></div>
			<div class="form-group">
				<div class="col-sm-4 col-sm-offset-3">
					<button class="btn btn-primary" type="submit"><i class="fa fa-save"></i> 保存</button>&nbsp;&nbsp;
					<a href="{:url('index')}" class="btn btn-danger"><i class="fa fa-arrow-left"></i> 返回 </a>
				</div>
			</div>
		</form>
	</div>
</div>
{/block} {block name="script"}
<script src="__JS__/jquery.form.js"></script>
<script src="__JS__/map.js"></script>
<script src="__LIB__/validate/jquery.validate.min.js"></script>
<script src="__LIB__/validate/messages_zh.min.js"></script>
<script src="__LIB__/validate/add_validate.min.js"></script>
<script src="__LIB__/fileinput/js/fileinput.min.js"></script>
<script src="__LIB__/fileinput/js/locales/zh.js"></script>
<script src="__LIB__/datepicker/WdatePicker.js"></script>
<script src="__LIB__/ueditor/ueditor.config.js" type="text/javascript"></script>
<script src="__LIB__/ueditor/ueditor.all.js" type="text/javascript"></script>
<script>
//编辑器
	upload_one('__IMG__/default.jpg');
	$(function() {
		$("#myForm").validate({
			rules: {
				no: "required",
				name:"required"
			},
			messages: {
				no: ICON.error + "请输入工 号",
				name:ICON.error + "请输入姓名"
			},
			
		});
	});
</script>
<script>
	function jiancha(){
		var value = document.getElementById("validit").checked;
		if(value == true){
			$("input[name='validity_date']").val('');
			$("input[name='validity_date']").attr('disabled',true);
		}else if(value == false){
			$("input[name='validity_date']").attr('disabled',false);
		}
	}
</script>
{/block}